πŸ›©οΈTutorial-04

Step 1: The First Principle

The most fundamental truth is this: A website is not one single file.

It's a collection of different files (HTML, CSS, JavaScript, images, videos, fonts) organized into folders.

Step 2: The Core Problem

If index.html needs to show an image logo.png, how does the browser know where to find it?

A file path is that address.

A) Relative File Paths

Most common in projects. Path is written starting from the current file location.

my-website/
β”œβ”€β”€ index.html
β”œβ”€β”€ about.html
β”‚
β”œβ”€β”€ images/
β”‚   β”œβ”€β”€ logo.png
β”‚   └── hero.jpg
β”‚
└── pages/
    β”œβ”€β”€ contact.html
    └── terms.html
  

Scenario 1: Same Folder


About Us
  

Scenario 2: Sub Folder


Logo
  

Scenario 3: Parent Folder


Logo
  

B) Absolute File Paths

Used for resources on other websites.

Search on Google

  

Summary / Rules of Thumb

Absolute Path Example

Windows

C:\Users\JohnDoe\Documents\report.docx

macOS / Linux

/Users/johndoe/Documents/report.docx

HTML Boilerplate Code




  
  
  Document





  

Why Use Boilerplate?

Multipage Website

Websites are usually multi-page with navigation links and consistent header/footer.

The <div> Tag

Arjun Kumar

Loves to code and teach HTML.

class and id

...
...

The <span> Tag

This is very important information.

Semantic Tags